﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace Models
{
    public class WarehouseView : ViewBase
    {
        [Display(Name = "单位")]
        public AreaView Area { get; set; }
        public int? AreaID { get; set; }

        [Display(Name = "仓库名称")]
        public string WarehouseName { get; set; }

        [Display(Name = "仓库容量(吨)")]
        public double TotalVolume { get; set; }

        public WarehouseView(Warehouse w)
        {
            Area = new AreaView(w.Area);
            AreaID = w.AreaID;
            Description = w.Description;
            ID = w.ID;
            Sequence = w.Sequence;
            TotalVolume = w.TotalVolume;
            WarehouseName = w.WarehouseName;
        }
    }

    public class Warehouse:EntityBase
    {
        [Display(Name = "单位")]
        public Area Area { get; set; }
        public int? AreaID { get; set; }

        [Display(Name = "仓库名称")]
        public string WarehouseName { get; set; }

        [Display(Name="仓库容量(吨)")]
        public double TotalVolume { get; set; }

        public List<Stock> Stocks { get; set; }
    }
}